#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 10;
const ll INF = 0x7f7f7f7f;

int main() {
    int n;
    cin >> n;
    string s;
    while(n--) {
        int cnt = 0;
        cin >> s;
        for(int i = 0; i < s.length(); i++) {
            if(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u') {
                cnt++;
            }
        }
        cout << s << endl;
        if(cnt > s.length() - cnt) {
            cout << 1 << endl;
        } else {
            cout << 0 << endl;
        }
    }
}
